﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace My3DGame
{
    class Spaceship
    {
        private Game1 game1;

        public Spaceship(Game1 game1)
        {
            this.game1 = game1;
        }

        Model model;
        public void loadContent(ContentManager Content)
        {
            model = game1.Content.Load<Model>("spaceship");
        }

        public void Draw(Matrix view, Matrix world, Matrix projection)
        {
            foreach (ModelMesh mesh in model.Meshes)
            {
                foreach (BasicEffect eff in mesh.Effects)
                {
                    eff.EnableDefaultLighting();
                    eff.World = world;
                    eff.View = view;
                    eff.Projection = projection;
                }
                mesh.Draw();
            }
        }
    }
}
